package com.tencent.service;

import com.tencent.common.Configure;
import com.tencent.protocol.template.WxTemplateReqData;

/**
 * 获取微信用户信息
 * @author tangqh
 * @修改日期 2016-04-07 10:00:00
 */
public class TemplateMsgService extends BaseMessageService{

	public TemplateMsgService() throws IllegalAccessException, InstantiationException, ClassNotFoundException {
        super(Configure.TEMPLATE_SEND_API.replace("ACCESS_TOKEN", WxAccessTokenService.getAccessToken(Configure.getAppid(), Configure.getAppSecret())));
    }

    /**
     * 请求支付服务
     * @param scanPayReqData 这个数据对象里面包含了API要求提交的各种数据字段
     * @return API返回的数据
     * @throws Exception
     */
    public String request(WxTemplateReqData wxTemplateReqData) throws Exception {
        //--------------------------------------------------------------------
        //发送HTTPS的Post请求到API地址
        //--------------------------------------------------------------------
        String responseString = sendPost(wxTemplateReqData);
        
        return responseString;
    }

}
